import request from "@/util/req";


// 添加地址
export function addRess(userid:string,name:string,tel:string,province:string,city:string,county:string,addressDetail:string,isDefault:boolean){
    return request.post('/address/add',{
        userid,
        name,
        tel,
        province,
        city,
        county,
        addressDetail,
        isDefault
    })
}

// 虎丘地址列表
export function getRess(userid:string){
    return request.get('/address/list',{
        params:{
            userid
        }
    })
}

// 删除地址
export function removeRess(addressid:string){
    return request.post("/address/delete",{
        addressid
    })
    
}

// 查看默认地址
export function getDefault(userid:string){
    return request.post("address/defaultAddress",{
        userid
    })
}
 
// 更新指定地址数据
export function updateRess(addressid:string,userid:string,name:string,tel:string,province:string,city:string,county:string,addressDetail:string,isDefault:boolean){
    return request.post('address/update',{
        addressid,
        userid,
        name,
        tel,
        province,
        city,
        county,
        addressDetail,
        isDefault
    })
}